/**
 * 
 */

package moviles.uniandes.quickmeals.interfaz;

import moviles.uniandes.quickmeals.R;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

/**
 * @author b0b
 */
public class StandardMenuListView extends ListActivity {

    // ----------------------------------------------------------------------------------
    // ATRIBUTOS
    // ----------------------------------------------------------------------------------
    /**
     * Atributo que modela los productos pedidos
     */
    private String[] order;

    /**
     * Atributo que modela el total de la orden
     */
    private int total;

    /**
     * Atributo que modela el menu del restaurante
     */
    private String[] menu;
    // ----------------------------------------------------------------------------------
    // CONSTRUCTOR
    // ----------------------------------------------------------------------------------
    /**
     * Constructor por defecto de la clase
     */
    public StandardMenuListView() {
    }

    // ----------------------------------------------------------------------------------
    // METODO ONCREATE
    // ----------------------------------------------------------------------------------
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        menu = getResources().getStringArray(R.array.menu_corral_drinks);
        setListAdapter(new ArrayAdapter<String>(this, R.layout.standard_menu, menu));
        
        ListView lv = getListView();
        lv.setTextFilterEnabled(true);

        lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                // When clicked, show a toast with the TextView text
                String listChoiceName = (String)((TextView)view).getText();
            }
        });
    }

}
